<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ChangeLog extends Model
{
    public $timestamps = false;
    protected $connection = 'mysql_center';
    protected $table = 'electric_change_log';


    public function getTypeAttribute()
    {
        $type = $this->attributes['type'];
        $return = '未知';
        switch ($type){
            case 1:
                $return = '电表';
                break;
            case 2:
                $return = '水表';
                break;
            case 3:
                $return = '采集器';
                break;
        }
        return $return;
    }
}
